package data.stock;

import java.io.Serializable;

/**
 * The news story class contains a single piece of news.
 * Implementation is self-explanatory.
 * @author Kevin Dolan
 */
public class NewsStory implements Serializable {

	private static final long serialVersionUID = 7835502890696246136L;
	
	private long time;
	private String publication;
	private String title;
	private String summary;
	private String content;
	private transient Integer id;
	
	public NewsStory(long date, String publication, String title,
			String summary, String content) {
		super();
		this.time = date;
		this.publication = publication;
		this.title = title;
		this.summary = summary;
		this.content = content;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
	}

	public String getPublication() {
		return publication;
	}

	public void setPublication(String publication) {
		this.publication = publication;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}
	
	/**
	 * Return an identical news story, 
	 * note that id will not persist
	 */
	public NewsStory clone() {
		return new NewsStory(time, publication, title, summary, content);
	}
}
